package com.example.day_blog.service;

import com.example.day_blog.mapper.CommentMapper;
import com.example.day_blog.model.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author starsea
 * @date 2024-01-27 12:44
 */
@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;
    public List<Comment> getComments(Integer blogId)
    {
        return commentMapper.sumComment(blogId);
    }
    //插入一条评论
    public Integer insertComment(Comment comment)
    {
        return commentMapper.insertComment(comment);
    }
}
